package yw.nmh.ranchInfo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

@Data
@Schema(description = "修改牧场DTO")
public class  RanchUpdateDTO implements Serializable {
    @NotNull(message = "牧场ID不能为空")
    @Schema(description = "牧场ID")
    private Integer id;

    @NotNull(message = "牲畜品种ID不能为空")
    @Schema(description = "牲畜品种ID")
    private Integer valId;

    @NotBlank(message = "牧场名称不能为空")
    @Size(max = 100, message = "牧场名称最长100个字符")
    @Schema(description = "牧场名称")
    private String name;

    @NotNull(message = "场地规模不能为空")
    @Min(value = 100, message = "场地规模不能小于100平方米")
    @Max(value = 999999, message = "场地规模不能超过999999平方米")
    @Schema(description = "场地规模(平方米)")
    private Integer area;

    @NotNull(message = "养殖规模不能为空")
    @Max(value = 999999, message = "养殖规模不能超过999999")
    @Schema(description = "养殖规模")
    private Integer breedingScale;

    @NotBlank(message = "城市不能为空")
    @Size(max = 50, message = "城市名称最长50个字符")
    @Schema(description = "城市")
    private String city;

    @NotBlank(message = "省份不能为空")
    @Size(max = 50, message = "省份名称最长50个字符")
    @Schema(description = "省份")
    private String province;

    @NotBlank(message = "区县不能为空")
    @Size(max = 50, message = "区县名称最长50个字符")
    @Schema(description = "区县")
    private String district;

    @NotBlank(message = "详细地址不能为空")
    @Size(max = 255, message = "详细地址最长255个字符")
    @Schema(description = "详细地址")
    private String detailedAddress;

    @NotNull(message = "纬度不能为空")
    @DecimalMin(value = "-90.0", message = "纬度不能小于-90")
    @DecimalMax(value = "90.0", message = "纬度不能大于90")
    @Schema(description = "纬度")
    private BigDecimal latitude;

    @NotNull(message = "经度不能为空")
    @DecimalMin(value = "-180.0", message = "经度不能小于-180")
    @DecimalMax(value = "180.0", message = "经度不能大于180")
    @Schema(description = "经度")
    private BigDecimal longitude;
}
